package models;

import java.util.ArrayList;
import java.util.Date;

import siena.*;

public class Transport extends Model{

	@Id(Generator.AUTO_INCREMENT)
	private Long id;
	@NotNull
	private User owner;
	@NotNull
	private String comingFrom;
	@NotNull
	private int numberOfSeats;
	private ArrayList<Long>passengers;
	private Date created;
	private Date modified;
	
	public Transport(User owner, String comingFrom, int numberOfSeats){
		this.owner = owner;
		this.comingFrom = comingFrom;
		this.numberOfSeats = numberOfSeats;
		this.passengers = new ArrayList<>(numberOfSeats);
		this.created = new Date();
		this.modified = created;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public User getOwner() {
		return owner;
	}

	public void setOwner(User owner) {
		this.owner = owner;
	}

	public String getComingFrom() {
		return comingFrom;
	}

	public void setComingFrom(String comingFrom) {
		this.comingFrom = comingFrom;
	}

	public int getNumberOfSeats() {
		return numberOfSeats;
	}

	public void setNumberOfSeats(int numberOfSeats) {
		this.numberOfSeats = numberOfSeats;
	}

	public ArrayList<Long> getPassengers() {
		return passengers;
	}

	public void setPassengers(ArrayList<Long> passengers) {
		this.passengers = passengers;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public Date getModified() {
		return modified;
	}

	public void setModified(Date modified) {
		this.modified = modified;
	}
	
}
